home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-06-16 | 484 b | 24 lines | [TEXT/YERK] |
- \ general 2 dimensional array class. Want this to be in the dictionary
- \ since it is pre-loaded with values
- :CLASS 2dArray <super array
-
- int xlimit
- int ylimit
-
- :M xlimit: get: xlimit ;M
- :M yLimit: get: ylimit ;M
-
- ( i j -- n )
- :M ^ELEM: get: xlimit * + 4* ixaddr: self + ;M
-
- ( 0.66 msec )
- :M AT: ^elem: self @ ;M
- ( .60 msec )
- :M TO: ^elem: self ! ;M
-
- :M CLASSINIT: { x \ y -- } limit: self -> y
- x put: xlimit y put: ylimit
- x y * dup ^base 6 + w! y - 4* reserve ;M
-
- ;CLASS
-